package com.fanqwz.kotlinmvvm.common.util.rxjava

import io.reactivex.Single
import io.reactivex.SingleSource
import io.reactivex.SingleTransformer
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers

/**
 * Created by fanqwz on 2017/11/8.
 */

class ThreadComposer<T> : SingleTransformer<T, T> {
    override fun apply(p0: Single<T>): SingleSource<T> {
        return p0.subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
    }

}